<template>
  <div class="search-bar-wrapper">
    <Search style="height: 2rem"></Search>
    <span class="add-btn" @click="router.push(props.path)">
      <var-icon name="plus" class="icon" />
      新建
    </span>
  </div>
  <div class="gasket"></div>
</template>
<script setup name="SearchBar">
import { defineProps } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter();

const props = defineProps({
  path: String,
});
</script>
<style scoped lang="less">
.search-bar-wrapper {
  display: grid;
  grid-template-columns: 1fr 3.4rem;
  grid-column-gap: 0.3rem;
  padding: 0.6rem 0.5rem 0 0.5rem;
  background-color: var(--system-primary-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.2rem;
  box-sizing: border-box;
  z-index: 10;
  .add-btn {
    height: 2rem;
    color: #fff;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, .5);
    box-sizing: border-box;
    background-color: var(--system-primary-color);
    .icon {
      color: #fff;
      font-size: 0.75rem;
    }
  }
}
.gasket {
  width: 100%;
  height: 3.2rem;
}
</style>
